﻿using Compass.PurchaseService.Domain.Entities;
using MediatR;
using Microsoft.EntityFrameworkCore;
using Zack.Infrastructure.EFCore;

namespace Compass.PurchaseService.Infrastructure;

public class PurchaseDbContext:BaseDbContext
{
    public DbSet<NavItem> NavItems { get; set; }
    public DbSet<NavInvValuation> NavInvValuations { get; set; }
    public DbSet<NavInvReportClass> NavInvReportClasses { get; set; }
    public DbSet<NavInvReportGroup> NavInvReportGroups { get; set; }


    public PurchaseDbContext(DbContextOptions<PurchaseDbContext> options, IMediator? mediator) : base(options, mediator)
    {
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.ApplyConfigurationsFromAssembly(GetType().Assembly);
        modelBuilder.EnableSoftDeletionGlobalFilter();
    }
}